package com.thrd.taiexhibition.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.thrd.basicframework.bean.BaseFragment;

import java.util.List;

/**
 * @author: ${唐杰}
 * @date: 2021/3/3
 */
public class HomeAdapter extends FragmentPagerAdapter { //FragmentPagerAdapter
    private FragmentManager fm;
    private int behavior;
    private List<BaseFragment> fragmentList;
    public HomeAdapter(@NonNull FragmentManager fm, int behavior, List<BaseFragment> fragmentList) {
        super(fm, behavior);
        this.fm=fm;
        this.behavior=behavior;
        this.fragmentList=fragmentList;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
}
